package cn.vire.electric.simulation.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 * 事件监听
 */
@Slf4j
@Component
public class SimulateListener {

    @Async
    @TransactionalEventListener(classes = Object.class, phase = TransactionPhase.AFTER_COMMIT, fallbackExecution = true)
    public void listenSimulateCmd4ConnectStatus(Object simulateCmdLastSnapshot) {
        log.info("收到事件[{}]", simulateCmdLastSnapshot);
        try {
        } catch (Exception e) {
            log.error("处理仿真链路文件数据异常捕获", e);
        }
    }




    public static void main(String[] args) {
        int a = 1;
        int b = 3;
        System.out.println((a + b) + "_" + (b - a));
    }

}
